package middleware

import (
	"cashway.com/cis/assistant/types"
)

func UseAsync[T any](handle types.HandleFunc[T]) types.HandleFunc[T] {
	return func(resp *types.ResponseWriter, req *types.Request[T]) {
		req.IsAsync = true
		handle(resp, req)
	}
}
